package com.gbx.ximalayating.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;

import com.gbx.ximalayating.R;
import com.gbx.ximalayating.activity.HottestRecommendActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class DownloadingFragment extends Fragment implements View.OnClickListener {


    private ListView listView;

    public DownloadingFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_downloading, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        listView = (ListView) view.findViewById(R.id.downloading_list_view);
        LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.downloading_empty_container);
        Button button = (Button) linearLayout.findViewById(R.id.downloading_empty_btn);
        button.setOnClickListener(this);
        listView.setEmptyView(linearLayout);
    }

    @Override
    public void onClick(View v) {
        Toast.makeText(getActivity(),"暂无界面", Toast.LENGTH_SHORT).show();
        Intent intent=new Intent(getActivity(), HottestRecommendActivity.class);
        startActivity(intent);
    }
}
